import Vuex from 'vuex'; // 引入 Vuex
import VuexPersistence from 'vuex-persist'; // 引入 Vuex 持久化插件\

const vuexLocal = new VuexPersistence({
    key: 'global-language',
    storage: window.localStorage,
});

const store = new Vuex.Store({
    plugins: [vuexLocal.plugin],
    state: {
        isChinese: true, // 默认语言状态
    },
    mutations: {
        setLanguage(state, language) {
            state.isChinese = language;
        }
    }
});

export default store;